package cn.ztr.ymcc.feign;

import cn.ztr.ymcc.result.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

@Component
public class CourseUserLearnFeignImpl implements FallbackFactory<CourseUserLearnFeign> {
    @Override
    public CourseUserLearnFeign create(Throwable throwable) {
        return new CourseUserLearnFeign() {
            @Override
            public JsonResult getLearnByLoginIdAndCourseId(Long loginId, Long courseId) {
                return JsonResult.me("查询用户购买信息失败"+throwable.getMessage());
            }
        };
    }

}
